package com.imjohn.service;

import com.imjohn.entity.Comment_mid;
import com.imjohn.mapper.CommentmidMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

@Service
public class CommentmidService {
    @Autowired
    CommentmidMapper commentmidMapper;
    /**
     *  是否点过赞
     * */
    public List<HashMap> isCommentGoodFlag ( String userId, String commentId) {
        return commentmidMapper.isCommentGoodFlag(userId, commentId);
    }
    /**
     * 插入点赞表
     * */
    public int setCommentGoodFlag (String userId, String commentId, String commentGoodFlag) {
        // 点赞
        return commentmidMapper.setCommentGoodFlag(userId, commentId, commentGoodFlag);
    }
    /**
     * 取消点赞
     * */
    public int cancelCommentGoodFlag ( Comment_mid comment_mid ) {
        return commentmidMapper.cancelCommentGoodFlag(comment_mid);
    }
}
